home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / infosrvr / dev / www_talk.930 / 000111_connolly@pixel.convex.com _Sun Jun 7 08:20:25 1992.msg < prev    next >
Internet Message Format  |  1994-01-24  |  2KB

  1. Return-Path: <connolly@pixel.convex.com>
  2. Received: from dxmint.cern.ch by  nxoc01.cern.ch  (NeXT-1.0 (From Sendmail 5.52)/NeXT-2.0)
  3.     id AA09268; Sun, 7 Jun 92 08:20:25 MET DST
  4. Received: by dxmint.cern.ch (dxcern) (5.57/3.14)
  5.     id AA14076; Sun, 7 Jun 92 08:18:31 +0200
  6. Received: from convex-inet.convex.com by mcsun.EU.net with SMTP
  7.     id AA06010 (5.65b/CWI-2.167); Sun, 7 Jun 1992 08:18:19 +0200
  8. Received: from pixel.convex.com by convex.convex.com (5.64/1.35)
  9.     id AA14512; Sun, 7 Jun 92 01:15:38 -0500
  10. Received: from localhost by pixel.convex.com (5.64/1.28)
  11.     id AA15478; Sun, 7 Jun 92 01:15:36 -0500
  12. Message-Id: <9206070615.AA15478@pixel.convex.com>
  13. To: www-talk@nxoc01.cern.ch
  14. Subject: overkill on portability macros
  15. Date: Sun, 07 Jun 92 01:15:34 CDT
  16. From: Dan Connolly <connolly@pixel.convex.com>
  17.  
  18. Are these abuses of the preprocessor really necessary?
  19.  
  20. ----
  21. PRIVATE char from_hex ARGS1(char, c)
  22. {
  23. }
  24. ----
  25. Ok, I've seen PRIVATE before (though I don't know what it's
  26. for. Some sort of MS DOS near/far thing?)
  27.  
  28. But ANSI C and PCC share syntax for _defining_ functions.
  29. The preprocessor dancing is necessary for _declaring_ functions
  30. like so:
  31.  
  32. int foo __ARGS__((int x, int y, int z));
  33.  
  34. but in the .c files, you can just do the usual
  35.  
  36. int foo(x,y,z)
  37. int x;
  38. int y;
  39. int z;
  40.  
  41. and ANSI an PCC compilers alike will be happy, with one
  42. exception: varargs. Functions with
  43.  
  44. int foo(int x, ...);
  45.  
  46. style declarations need corresponding
  47.  
  48. int foo(int x, ...)
  49. {
  50. }
  51.  
  52. style definitions.
  53.  
  54. Dan